home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16646 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  915 b 

  1. Path: news.internex.net.au!usenet
  2. From: sultan@connexus.apana.org.au (Jon Hornstein)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How do I put DIFFERENT classes in the same linked list?
  5. Date: Fri, 12 Apr 1996 09:17:58 GMT
  6. Organization: connexus.apana.org.au
  7. Message-ID: <4kjbjh$36u@preeda.internex.net.au>
  8. References: <4ka938$bj6@wintermute.ecs.fullerton.edu> <4kb8cg$2mp@cocoa.brown.edu>
  9. NNTP-Posting-Host: dialin-4.internex.net.au
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. cs032137@cs.brown.edu (Jeremy Rothman) wrote:
  13.  
  14. TEMPLATES
  15.  
  16. what about  template approach as in  STL for example, 
  17.  
  18. deque<MyClass> LinkedList;   
  19.  
  20. >In article <4ka938$bj6@wintermute.ecs.fullerton.edu>,
  21. >Gil Rosin <grosin@titan> wrote:
  22. >>class A
  23. >> {
  24. >>  public:
  25. >>    A *next;
  26. >>    A *prev;
  27. >>    void Print();
  28. >> };
  29.  
  30. >I think that your problem is that you need to make the Print function virtual.
  31.  
  32. >-- Jeremy Rothman
  33. >   Jeremy_Rothman@brown.edu
  34.  
  35.  
  36.  
  37.